from DbOperator import DbOperator
from pub.Config import Config
import random
import datetime,time
print time.strftime('%Y_%m_%d_%H_%M',time.localtime(time.time()))

exit()
class c():
	def b():
		pass
n = {}
t=c()
k=c()
n["w"]=t
n["p"]=k
n["o"]=k
n["b"]=k
n["a"]=k
n["r"]=k
tmp1 = {}
startposition=2
count=3
print n.keys()
d = n.items()[startposition:count+startposition]
for tmp in d:
	tmp1[tmp[0]]=tmp[1]
print "tmp1%s"%(tmp1)
print d
print type(d)
print n.values()[startposition]

test1=[t,k]
print test1
userNameList = {'a':k,'b':t}
test1.remove(userNameList['a'])
print test1
exit()
Db = DbOperator()
Sql = "SELECT Id,C_Char,FirstChar,Py_Char FROM  sq_idiom order by rand() limit 100"
Data = Db.findAll(Sql)
if(Data):
	for idiom in Data:
		insert_sql = " INSERT INTO sq_room(RoomName,Introduce,RoomType,UpLimit,Creator,Created,RoomFirstName,RoomPri,Commend,RoomIsShow) values(%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)"
		
		RoomIsShow = random.randint(0,1) 
		RoomType = 0
		Creator = 0
		UpLimit = 50
		RoomFirstName = idiom["FirstChar"]
		Commend = random.randint(0,20) 
		Created = Config.getNow()
		RoomName = idiom["C_Char"]
		RoomPri=0
		Introduce = "room created by programe which name is %s and pinyin is %s"%(idiom["C_Char"],idiom["C_Char"])
		Param = (RoomName,Introduce,RoomType,UpLimit,Creator,Created,RoomFirstName,RoomPri,Commend,RoomIsShow)
		insert_id = Db.executeAndGetId(insert_sql,Param)
		print insert_id
